package han.chensing.latos.maker.latos.config.parameter;

import org.luaj.vm2.LuaValue;

public class ConfigValueParameter extends ConfigParameter{
    protected float from;
    protected float to;
    protected float defaultValue;
    protected float value;

    public float getFrom() {
        return from;
    }

    public void setFrom(float from) {
        this.from = from;
    }

    public float getTo() {
        return to;
    }

    public void setTo(float to) {
        this.to = to;
    }

    public float getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(float defaultValue) {
        this.defaultValue = defaultValue;
    }

    public float getValue() {
        return value;
    }

    public void setValue(float value) {
        this.value = value;
    }

    @Override
    public void loadConfigFromTable(LuaValue[] objects) {
        super.name= objects[1].tojstring();
        this.from= objects[2].tofloat();
        this.to=objects[3].tofloat();
        this.value=this.defaultValue=objects[4].tofloat();
    }
}
